{% extends 'base.html' %}

{% block title %}用户登录 - 图书馆管理系统{% endblock %}

{% block content %}
<div class="row justify-content-center">
    <div class="col-md-6 col-lg-4">
        <div class="card">
            <div class="card-header text-center">
                <h3 class="card-title mb-0">
                    <i class="fas fa-sign-in-alt me-2"></i>用户登录
                </h3>
            </div>
            <div class="card-body">
                <form method="post">
                    {% csrf_token %}
                    
                    {% if form.errors %}
                    <div class="alert alert-danger">
                        <i class="fas fa-exclamation-triangle me-1"></i>
                        用户名或密码错误，请重试。
                    </div>
                    {% endif %}
                    
                    <div class="mb-3">
                        <label for="id_username" class="form-label">
                            <i class="fas fa-user me-1"></i>用户名
                        </label>
                        <input type="text" name="username" class="form-control" id="id_username" required>
                    </div>
                    
                    <div class="mb-3">
                        <label for="id_password" class="form-label">
                            <i class="fas fa-lock me-1"></i>密码
                        </label>
                        <input type="password" name="password" class="form-control" id="id_password" required>
                    </div>
                    
                    <div class="d-grid">
                        <button type="submit" class="btn btn-primary">
                            <i class="fas fa-sign-in-alt me-1"></i>登录
                        </button>
                    </div>
                </form>
                
                <hr>
                
                <div class="text-center">
                    <p class="text-muted mb-0">
                        还没有账号？请联系管理员创建账号
                    </p>
                </div>
            </div>
        </div>
        
        <div class="card mt-3">
            <div class="card-body">
                <h6 class="card-title">
                    <i class="fas fa-info-circle me-1"></i>登录说明
                </h6>
                <ul class="list-unstyled mb-0 small text-muted">
                    <li><i class="fas fa-check me-1"></i>登录后可借阅书籍</li>
                    <li><i class="fas fa-check me-1"></i>查看个人借阅记录</li>
                    <li><i class="fas fa-check me-1"></i>预约热门书籍</li>
                    <li><i class="fas fa-check me-1"></i>管理个人信息</li>
                </ul>
            </div>
        </div>
    </div>
</div>
{% endblock %} 